﻿namespace MvcXRepairAdmin.Services
{
    using System.Collections.Generic;
    using MvcXRepairAdmin.Interfaces;
    using MvcXRepairAdmin.Repository.SQL;
    using XRepair.Models;

    public class ServiceService : IServiceService
    {
        private ServiceDAO _serviceRepository;

        public ServiceService()
        {
            _serviceRepository = new ServiceDAO();
        }

        public IEnumerable<Service> GetAllActiveServices()
        {
            return _serviceRepository.GetAllActiveServices();
        }

        public bool DeactivateServiceByID(int id)
        {
            return _serviceRepository.DeactivateServiceByID(id);
        }

        public bool AddNewService(Service service)
        {
            return _serviceRepository.AddNewService(service);
        }

        public bool EditService(Service service)
        {
            return _serviceRepository.UpdateService(service);
        }
    }
}
